package com.oc;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.BasicEditField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;

class SalutationScreen extends MainScreen
{
	private Bitmap bmp = null;
	
    public SalutationScreen()
    {
        super();
        LabelField applicationTitle = new LabelField("Hello World Title");
        setTitle(applicationTitle);
        RichTextField helloWorldTextField = new RichTextField("Hello World!");
        add(helloWorldTextField);
        
    	bmp = Bitmap.getBitmapResource("images/back1.png");
    	MainScreen ms = new MainScreen();
    	
        HorizontalFieldManager hfm = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH | HorizontalFieldManager.USE_ALL_HEIGHT){
            //Override the paint method to draw the background image.
            public void paint(Graphics graphics)
            {
                //Draw the background image and then call paint.
                graphics.drawBitmap(0, 0, 360, 480, bmp, 0, 0);
                super.paint(graphics);
            }            
            
        };
        ms.add(hfm);
        
        BasicEditField bef = new BasicEditField("To: ","",50,BasicEditField.FILTER_EMAIL);
        hfm.add(bef);
        
    }
    public boolean onClose()
    {
        Dialog.alert("Bye World!");    
        System.exit(0);
           return true;
    }
    
    

}
